home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / U-Utilities / (c)u1.d64 / viclist.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  4KB  |  110 lines

  1. 0 POKE53280,1:POKE53281,1
  2. 2 REM DISK LISTER BY  BUTTERFIELD COMPUTE!  DEC 82-PG194  ADAPTED BY CHUCK WALLACE
  3. 4 PRINT"[147]     VIC DISKLIST":PRINT"    INSTRUCTIONS ?":PRINT"      (Y OR N)"
  4. 6 GETZ$:IFZ$=""THEN6
  5. 8 IFZ$="Y"THEN196
  6. 10 PRINT"[144][147]PLEASE WAIT....":GOTO160
  7. 12 REM ** CHECK FOR DISK ERROR **************************
  8. 14 INPUT#15,EN$,EM$,ET,ES:IFEN$="00"THENRETURN
  9. 16 PRINT"DISK ERROR:[146]"EM$;" ";EN$;ET;",";ES:END
  10. 18 REM ** CHECK FOR NEW PAGE ***************************
  11. 20 K%=K%+1:IFK%<J%THENRETURN
  12. 22 K%=0:FORI=1TOX1%:PRINT#4:NEXT:RETURN:REM ** PAGE FOWARDING ** X1% IS SPACING **
  13. 24 REM ** OUTPUT ****************************************
  14. 26 IFLEN(P$)<L9THENRETURN
  15. 28 FORJ=L9TOL9*.6STEP-1:IFMID$(P$,J,1)=":"THEN36
  16. 30 NEXTJ:FORJ=L9-1TOL9*.6-1STEP-1:P=ASC(MID$(P$,J)):IFP=91THEN36
  17. 32 IFP=59ORP=44ORP=93THENJ=J+1:GOTO36
  18. 34 NEXTJ:J=L9-1
  19. 36 PRINT#4,LEFT$(P$,J-1):GOSUB20:IFL<2THENL=2
  20. 38 K=INT(LOG(L)/LOG(10)+3):L1$="":FORK2=1TOK:L1$=L1$+" ":NEXTK2:P$=L1$+MID$(P$,J):RETURN
  21. 40 REM ** CLOSE OFF CURSOR EXPRESSION ******************
  22. 42 IFF1=0THENRETURN
  23. 44 IFB>0THENP$=P$+MID$(STR$(B+1),2):GOSUB26
  24. 46 B=0:F1=0:B1$="":P$=P$+P2$:GOSUB26:F$=P1$:RETURN
  25. 48 REM ** START PGM ************************************
  26. 50 CLOSE1:PRINT"[147]LOAD CORRECT DISK":PRINT"NAME OF PROGRAM":INPUTG$:OPEN15,8,15,"I"
  27. 52 OPEN1,8,3,G$+",P,R":B$="":GET#1,A$,B$:IFA$<>CHR$(1)ANDA$<>""THEN50
  28. 54 IFA$=""THENA$=CHR$(1):GET#1,X$
  29. 56 PRINT"LINE NUMBER RANGE":INPUT"  -[157][157][157]";Z$:L0=0:L1=0:L2=1E9:FORJ=1TOLEN(Z$)
  30. 58 Y$=MID$(Z$,J,1):Y=ASC(Y$):IFY>=48ANDY<=57THEN62
  31. 60 IFY<>32THENL0=J:IFY<>45THEN68
  32. 62 NEXTJ
  33. 64 IFL0<LEN(Z$)THENL2=VAL(MID$(Z$,L0+1)):IFL2=0THENL2=1E9
  34. 66 L1=L2:IFL0THENL1=VAL(Z$)
  35. 68 K%=1:P1$="[":P2$="]":P%=4:REM P% =PRINTR
  36. 70 PRINT"GRAPHICS OR TEXT (G/T)":INPUT"  G[157][157][157]";Z$
  37. 72 PRINTCHR$(142):X%=0:IFASC(Z$)=84THENPRINTCHR$(14):X%=7:REM ** X% GIVES UPPER/LOWER PRINT **
  38. 74 PRINT"COUNT CURSOR MOVES (Y/N)":INPUT"  Y[157][157][157]";Z$:IFZ$="Y"THENT7=1
  39. 76 PRINT"WHAT LINE LENGTH (60)":INPUTL9
  40. 78 PRINT"WHAT PAGE LENGTH (55)":INPUTJ%
  41. 80 PRINT"WHAT SPACING BETWEEN  PAGES (9)":INPUTX1%
  42. 82 IFJ%<1THENJ%=55
  43. 84 IFL9<1THENL9=60
  44. 86 IFX1%<1THENX1%=9
  45. 88 OPEN4,P%,X%:F$=P1$:PRINT#4,"     PROGRAM: ";G$
  46. 90 REM ** NEW LINE *************************************
  47. 92 GOSUB42:Q=0:T1=1:C1=-1:GET#1,A$,B$:IFST<>0ORB$=""THEN146:*LINK ADDRESS*
  48. 94 GET#1,A$,B$:GOSUB14:REM* LINE # *
  49. 96 L=ASC(A$+CHR$(0))+ASC(B$+CHR$(0))*256
  50. 98 IFL<L1THEN142
  51. 100 IFL>L2THEN146
  52. 102 F2=1:PRINT#4,P$:P$=STR$(L)+" ":GOSUB20
  53. 104 REM ** START TEXT HERE ******************************
  54. 106 GET#1,A$:GOSUB14:IFA$=""THEN92
  55. 108 T=0:A=ASC(A$):IFA=32THENIFF$=","THEN112
  56. 110 IFQ=0OR(AAND127)>31ORT7=0THEN124
  57. 112 FORJ=0TOF%:IFA=A(J)THENB$=A$(J):GOTO116
  58. 114 NEXTJ:GOTO130
  59. 116 IFB$=B1$THENB=B+1:GOTO106
  60. 118 IFBTHENA$=MID$(STR$(B+1),2)+F$+B$:GOTO122
  61. 120 A$=F$+B$
  62. 122 B=0:B1$=B$:F$=",":F1=1:GOTO132
  63. 124 A=A-128:IFA<0ORQ<>0THEN130
  64. 126 IFA=127THENA$="":GOTO130
  65. 128 T=1:A$=K$(A):IFA=15THENQ=2
  66. 130 GOSUB42
  67. 132 IFA$=CHR$(34)THENQ=1-Q
  68. 134 C=ASC(LEFT$(A$,1)):C=(C<48ORC>57)AND(C<65ORC>90):REM ** C=-1 FOR ALPHANUMERIC**
  69. 136 IFT<>T1ORT=1THENT1=T:IFNOTCTHENIFNOTC1THENP$=P$+" ":GOSUB26
  70. 138 C=ASC(RIGHT$(A$,1)):C1=((C<48ORC>57)AND(C<65ORC>90))ORA=37:P$=P$+A$:GOSUB26:GOTO106
  71. 140 REM ** SKIP TO NEXT LINE ****************************
  72. 142 GET#1,A$:GOSUB14:IFA$=""THEN92
  73. 144 GOTO142
  74. 146 IFLEN(P$)THENF2=1:PRINT#4,P$:GOSUB20
  75. 148 IFF2=0THENPRINT"** NO LINES FOUND **"
  76. 150 CLOSE1:GOSUB42:PRINT#4:CLOSE4:CLOSE15
  77. 152 PRINT"     ANOTHER ?"
  78. 154 GETZ$:IFZ$=""THEN154
  79. 156 IFZ$="Y"THEN50
  80. 158 END
  81. 160 F%=40:H%=256
  82. 162 DIMA(F%),A$(F%),K$(90):REM A()= SPECIAL, A$()= CURSOR CONTROLS, K$()= BASIC
  83. 164 FORI=.TO254:P$=P$+CHR$(65):NEXTI:P$=""
  84. 166 FORJ=0TOF%:READA(J):NEXT:FORJ=S%TOF%:READA$(J):NEXT:FORJ=0TO89:READK$(J):NEXT:GOTO50
  85. 168 DATA19,147,17,145,29,157,18,146,20,148,141,32
  86. 170 REM 80-COLUMN CURSOR STUFF
  87. 172 DATA7,21,149,22,150,14,142,25,153,15,143
  88. 174 REM VIC STUFF
  89. 176 DATA144,5,28,159,156,30,31,158,8,9,133,137,134,138,135,139,136,140
  90. 178 DATAHOME,CLEAR,DOWN,UP,RIGHT,LEFT,RVS,RVOFF,DEL,INST,S.RETURN,SPACE
  91. 180 DATABELL,D.LINE,I.LINE,ER.BEGIN,ER.END,TEXT,GRAPHIC,SCROLL.UP,SCROLL.DOWN,TOP,BOTTOM
  92. 182 DATABLACK,WHITE,RED,CYAN,MAGENTA,GREEN,BLUE,YELLOW,LOCK,UNLOCK,F1,F2,F3,F4,F5,F6,F7,F8
  93. 184 DATAEND,FOR,NEXT,DATA,INPUT#,INPUT,DIM,READ,LET,GOTO,RUN,IF,RESTORE,GOSUB
  94. 186 DATARETURN,REM,STOP,ON,WAIT,LOAD,SAVE,VERIFY,DEF,POKE,PRINT#,PRINT,CONT
  95. 188 DATALIST,CLR,CMD,SYS,OPEN,CLOSE,GET,NEW,TAB(,TO,FN,SPC(,THEN,NOT,STEP
  96. 190 DATA+,-,*,/,^,AND,OR,>,=,<,SGN,INT,ABS,USR,FRE,POS,SQR,RND,LOG,EXP,COS
  97. 192 DATASIN,TAN,ATN,PEEK,LEN,STR$,VAL,ASC,CHR$,LEFT$,RIGHT$,MID$,GO,CONCAT,DOPEN,DCLOSE
  98. 194 DATARECORD,HEADER,COLLECT,BACKUP,COPY,APPEND,DSAVE,CATALOG,RENAME,SCRATCH,DIRECTORY
  99. 196 PRINT"[144][147]THE CONFIGURATION IS":PRINT"A VIC-20 (>8K) OR 64,"
  100. 197 PRINT"1525 PRINTER, & A":PRINT"1541 DISK."
  101. 198 PRINT"LOAD[146] THE CORRECT DISK"
  102. 200 PRINT" ********************"
  103. 202 PRINT"PROMPTS ARE FOR:"
  104. 204 PRINT"1. NAME - EXACT NAME  AND/OR WILDCARDS"
  105. 206 PRINT"2. LINE LENGTH -SET AT60[146] BUT CAN BE CHANGED"
  106. 208 PRINT"3. PAGE LENGTH -SET AT57[146] BUT CAN BE CHANGED"
  107. 210 PRINT"HIT A KEY TO CONTINUE";
  108. 212 GETY$:IFY$=""THEN212
  109. 214 GOTO10
  110.